<?php
// TbBox
$this->beginWidget('bootstrap.widgets.TbBox', array(
	'title' => array(
		$this->projectName => array('project/schema'),
		'数据列表' => array('data/list'),
		'导入数据',
	),
	'headerIcon' => 'icon-plus-sign',
));

// Form
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'htmlOptions' => array('enctype' => 'multipart/form-data'),
	'type' => 'horizontal',
));	/* @var TbActiveForm $form */
?>
<fieldset>
	<legend>
		<?php
		// Button group
		$this->widget('bootstrap.widgets.TbButtonGroup', array(
			'type' => 'normal',
			'toggle' => 'radio',
			'buttons' => array(
				array('label' => '导入 CSV 文件', 'url' => array($this->route, 'type' => 'csv'), 'disabled' => true, 'active' => true),
				array('label' => '从数据库导入', 'url' => array($this->route, 'type' => 'db')),
			),
		));
		?>
	</legend>
	<?php
	// Tips	
	$this->widget('bootstrap.widgets.TbAlert', array(
		'block' => true, // display a larger alert block?
		'fade' => true, // use transitions?
		'closeText' => '×', // close link text - if set to false, no close link is displayed
		'alerts' => array('info', 'success', 'error'),
	));
	// inputs
	echo $form->fileFieldRow($model, 'file', array(
		'hint' => '文件大小不得超过 ' . ini_get('upload_max_filesize'),
		'accept' => 'text/csv',
		'class' => 'span5',
	));
	echo $form->textFieldRow($model, 'delim', array(
		'hint' => '只允许一个字符，可采用 \t 或 \x09 表示制表符',
		'class' => 'span5',
	));
	?>
	<div class="control-group">
		<div class="controls">
			<?php
			$this->widget('bootstrap.widgets.TbButton', array(
				'buttonType' => 'submit',
				'type' => 'primary',
				'label' => '确定导入',
			));
			?>
		</div>
	</div>
</fieldset>
<?php $this->endWidget(); ?>
<?php $this->endWidget(); ?>
